
(**********************************************************************)
(*                                                                    *)
(*        FLXKEY UNIT 1.10 COPYRIGHT (c) 1993, GUY MCLOUGHLIN         *)
(*                                                                    *)
(*     Shareware unit to create encrypted registration-key files.     *)
(*                                                                    *)
(*         Supports Turbo Pascal 4.0, 5.0, 5.5, 6.0, and 7.0          *)
(**********************************************************************)

{$IFDEF VER40}
  {$B-,D-,F+,I-,L-,N-,R-,S+,V+}
{$ENDIF}

{$IFDEF VER50}
  {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V+}
{$ENDIF}

{$IFDEF VER55}
  {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V+}
{$ENDIF}

{$IFDEF VER60}
  {$A+,B-,D-,E-,F+,G-,I-,L-,N-,O+,R-,S+,V+,X-}
{$ENDIF}

{$IFDEF VER70}
  {$A+,B-,D-,E-,F+,G-,I-,L-,N-,O+,P-,Q-,R-,S+,T-,V+,X-}
{$ENDIF}

unit FlxKey;

interface

              (* Type definitions.                                    *)
type
  st_20  = string[20];
  st_30  = string[30];
  st_79  = string[79];
  st_100 = string[100];
  st_254 = string[254];

              (* FLX record definition.                               *)
  rc_Flx = record
             FirstName : st_20;
             LastName  : st_30;
             Address1  : st_30;
             Address2  : st_30;
             Address3  : st_30;
             AppName   : st_20;
             Version   : word;
             Serial    : longint;
             Date      : longint;
             Access    : word;
             MiscData  : st_254
           end;


  (***** Create encrypted registration-key file using INrec data,     *)
  (*     Ecode1 and Ecode2 encryption-codes, and the OUTname filname  *)
  (*     path.                                                        *)
  (*                                                                  *)
  procedure CreateFlxKey({ input}     INrec   : rc_Flx;
                                      Ecode1  : st_100;
                                      Ecode2  : st_100;
                                      OUTname : st_79;
                         {update} var Error   : word);


  (***** Check and decode registration-key file called INname, use    *)
  (*     Ecode1 and Ecode2 to decrypt this file. Decrypted data will  *)
  (*     be placed in OUTrec record, and the DaysOld variable will be *)
  (*     set to indicate the age of the registration key-file.        *)
  (*                                                                  *)
  procedure ReadFlxKey({ input}     Ecode1  : st_100;
                                    Ecode2  : st_100;
                                    INname  : st_79;
                       {update} var OUTrec  : rc_Flx;
                                var DaysOld : word;
                                var Error   : word);


